var data = [
    { "ID": "B01", "theno": "HUAYUAN001", "shipname": "华远001", "transportqty": "233", "thedate": "2021-10-09" },
    { "ID": "02", "theno": "HYSY685", "shipname": "海洋石油685", "transportqty": "2543", "thedate": "2021-10-09" },
    { "ID": "03", "theno": "HYSY651", "shipname": "海洋石油651", "transportqty": "2333", "thedate": "2021-10-09" },
    { "ID": "04", "theno": "DETAO", "shipname": "德涛", "transportqty": "3233", "thedate": "2021-10-09" },
    { "ID": "05", "theno": "DEPEI", "shipname": "德沛", "transportqty": "2353", "thedate": "2021-10-09" },
];

// 用户ID
let id = getUrlParam("id");
$(function () {
    GetUserRole();
});
//获取用户权限
function GetUserRole() {
    // let thisdata = [];
    // thisdata.push(InitRole(id));
    let USERdata = InitRole(id);
    if (USERdata != null) {
        InitData();
    }
    else OpenErrmsg("../../web/errhtml/404.html");
}
// 重置按钮
function ReInitData() {
    $('#db_Start').datebox('setValue', GetDateStr(-7));
    $('#db_End').datebox('setValue', getCurrDate());
    InitData();
}
function chooseSearch() {
    var isok = $("#ck_search").is(':checked');
    if (isok) {
        $("#div_Search").show();
        $('#db_Start').datebox('setValue', GetDateStr(-7));
        $('#db_End').datebox('setValue', getCurrDate());
    }
    else {
        $("#div_Search").hide();
        $('#db_Start').datebox('setValue', "");
        $('#db_End').datebox('setValue', "");
    }
}
function InitData() {
    $('#dg_WorkPlanList').datagrid({
        data: data,
        onLoadSuccess: function (data) {
            $("#tb01").css("background-color", "white");
        }
    });
}

